@extends('layouts.default')  
@section('content')
<div style="text-align:left;" class="box primary">
    <header>
        <div class="icons">
            <i class="fa fa-edit"></i>
        </div>
        <h5>{{Lang::get('rentals.create_rental')}}</h5>
        <div class="toolbar">
            <nav style="padding: 8px;">
                <a href="javascript:;" class="btn btn-default btn-xs collapse-box">
                    <i class="fa fa-minus"></i>
                </a> 
                <a href="javascript:;" class="btn btn-default btn-xs full-box">
                    <i class="fa fa-expand"></i>
                </a> 
                <a href="javascript:;" class="btn btn-danger btn-xs close-box">
                    <i class="fa fa-times"></i>
                </a> 
            </nav>
        </div>
    </header>
    <div id="div-1" class="body">
        @foreach ($values as $v)
        {{ Form::model($v, array(
                        'route' => array('res.update', $v->rentalId),
                        'method' => 'PUT',
                        'class'=>'form-horizontal',
                        'id'=>'form-validate')) 
        }}
        <div style="float:right;">
            <span class="btn btn-warning btn-xs">{{Lang::get('messages.class').': '.$v->class_name}}</span>
            <span class="btn btn-warning btn-xs">{{Lang::get('messages.license').': '.$v->License}}</span>
            <span class="btn btn-warning btn-xs">{{Lang::get('messages.model').': '.$v->Model}}</span>
        </div><button class="btn btn-success" style="float:left;" id="ex_customers"><i class="fa fa-search" ></i> Customers</button><br/><br/>
        <div style="text-align:center;" class="alert alert-info" ><b>Klienti</b></div> 

        <div class="form-group">
            {{ Form::label('cfirstname', Lang::get('rentals.cfirstname').'*', 
                            array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('cfirstname',isset($v->drfirstname)?$v->drfirstname:'' , array(
                                'placeholder' =>Lang::get('rentals.cfirstname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>               
        </div> 
        <div class="form-group">
            {{ Form::label('clastname', Lang::get('rentals.clastname').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('clastname',isset($v->drlastname)?$v->drlastname:'' , array(
                                'placeholder' =>Lang::get('rentals.clastname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div> 
        <div class="form-group">
            {{ Form::label('drpasportid', Lang::get('rentals.drpasportid').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drpasportid','', array(
                                'placeholder' =>Lang::get('rentals.drpasportid'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('caddress', Lang::get('rentals.caddress').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('caddress','', array(
                                'placeholder' =>Lang::get('rentals.caddress'),
                                'class' => 'form-control',
                              )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('drcity', Lang::get('rentals.drcity').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drcity','' , array(
                                'placeholder' =>Lang::get('rentals.drcity'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('drcountry', Lang::get('rentals.drcountry').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drcountry','', array(
                                'placeholder' =>Lang::get('rentals.drcountry'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('dremail', Lang::get('rentals.dremail'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('dremail','' , array(
                                'placeholder' =>Lang::get('rentals.dremail'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('drhphone', Lang::get('rentals.drhphone').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drhphone',isset($v->drhphone)?$v->drhphone:'' , array(
                                'placeholder' =>Lang::get('rentals.drhphone'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('workphone', Lang::get('rentals.workphone'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('workphone','' , array(
                                'placeholder' =>Lang::get('rentals.workphone'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('companyname', Lang::get('rentals.companyname'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('companyname','' , array(
                                'placeholder' =>Lang::get('rentals.companyname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div style="text-align:center;" class="alert alert-info" ><b>Shoferi Kryesor</b></div>

        <div class="form-group">
            {{ Form::label('drfirstname', Lang::get('rentals.drfirstname').'*', 
                            array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drfirstname',isset($v->drfirstname)?$v->drfirstname:'', array(
                                'placeholder' =>Lang::get('rentals.drfirstname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>               
        </div> 
        <div class="form-group">
            {{ Form::label('drlastname', Lang::get('rentals.drlastname').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drlastname',isset($v->drlastname)?$v->drlastname:'', array(
                                'placeholder' =>Lang::get('rentals.drlastname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div> 
        <div class="form-group">
            {{ Form::label('drbdate', Lang::get('rentals.drbdate').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">               
                {{ Helpers\Helper::date('drbdate','' , array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('drlexpdate', Lang::get('rentals.drlexpdate').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">               
                {{ Helpers\Helper::date('drlexpdate','' , array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('drliccat', Lang::get('rentals.drliccat').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drliccat','', array(
                                'placeholder' =>Lang::get('rentals.drliccat'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('drlicnr', Lang::get('rentals.drlicnr').'*', 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('drlicnr','', array(
                                'placeholder' =>Lang::get('rentals.drlicnr'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div style="text-align:center;" class="alert alert-info" ><b>Shoferi Tjeter</b></div>

        <div class="form-group">
            {{ Form::label('dr2fname', Lang::get('rentals.dr2fname'), 
                            array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('dr2fname','', array(
                                'placeholder' =>Lang::get('rentals.dr2fname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>               
        </div> 
        <div class="form-group">
            {{ Form::label('dr2lastname', Lang::get('rentals.dr2lastname'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('dr2lastname','', array(
                                'placeholder' =>Lang::get('rentals.dr2lastname'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div> 
        <div class="form-group">
            {{ Form::label('draddress', Lang::get('rentals.draddress'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('draddress','', array(
                                'placeholder' =>Lang::get('rentals.draddress'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('dr2bdate', Lang::get('rentals.dr2bdate'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">               
                {{ Helpers\Helper::date('dr2bdate', '' , array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('dr2licexpdate', Lang::get('rentals.dr2licexpdate'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">               
                {{ Helpers\Helper::date('dr2licexpdate','', array(
                                'class' => 'form-control')) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('dr2liccat', Lang::get('rentals.dr2liccat'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('dr2liccat','', array(
                                'placeholder' =>Lang::get('rentals.dr2liccat'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('dr2licnr', Lang::get('rentals.dr2licnr'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('dr2licnr','', array(
                                'placeholder' =>Lang::get('rentals.dr2licnr'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('dr2city', Lang::get('rentals.dr2city'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('dr2city','', array(
                                'placeholder' =>Lang::get('rentals.dr2city'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('dr2country', Lang::get('rentals.dr2country'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('dr2country','', array(
                                'placeholder' =>Lang::get('rentals.dr2country'),
                                'class' => 'form-control',
                                )) 
                }}
            </div>
        </div>
        <div  class="form-group" >
            {{ Form::label('fuelin', Lang::get('messages.fuel'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div id="slider" class="col-lg-6 slider" style="width: 40%; left:25px;text-align: right;"><br/>
                <div class="slider-div"></div>
                {{ Form::text('fuelin',  isset($v->fuel) ? $v->fuel : '', array(
                                'style' => 'border:0; color:blue; width: 10%; font-weight:bold;',
                                'class'=>'fuel')) }}                           
            </div>                                
        </div>
        <div class="form-group">
            {{ Form::label('kmin', Lang::get('messages.milage'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::text('kmin',isset($v->Milage) ? $v->Milage: '', array(
                                'placeholder' =>Lang::get('messages.milage'),
                                'class' => 'form-control',
                                'readonly'=>true,
                                )) 
                }}
            </div>
        </div>
        <div class="row form-group">
            {{ Form::label('nrdays', Lang::get('rentals.result'), 
                    array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-1">
                {{Form::text ('nrdays',isset($v->rentdays) ? $v->rentdays: '', array(
                                'placeholder' =>Lang::get('rentals.nrdays'),
                                'class' => 'form-control',
                                'readonly'=>true))}}
            </div><!-- /.col-lg-4 -->
            <div class="col-lg-2">
                {{Form::text ('rate',isset($v->rate_value) ? $v->rate_value: '', array(
                                'placeholder' =>Lang::get('rentals.rate'),
                                'class' => 'form-control'))}}
            </div><!-- /.col-lg-4 -->
            <div class="col-lg-1">
                <a id="res-btn" class="btn btn-default" data-original-title="" title="">=</a>
            </div>
            <div class="col-lg-2">
                {{Form::text ('result',isset($result) ? $result: '', array(
                                'placeholder' =>Lang::get('rentals.result'),
                                'class' => 'form-control',
                                'id'=>'result-reservation'))}}
            </div>
                     
        </div>
        <div class="form-group">
            {{ Form::label('curency', Lang::get('rentals.curency'), array('class'=>'control-label col-lg-4')) }}          
            <div class="col-lg-6">
                {{ Form::select('curency',$currencies, isset($v->curency)?$v->curency:'', array(
                                'class' => 'form-control',
                                'placeholder'=>Lang::get('rentals.curency'))) 
                }}
            </div>  
        </div>
        <div class="form-group">
            {{ Form::label('agency', Lang::get('rentals.agency'), array('class'=>'control-label col-lg-4')) }}
            <div class="col-lg-6">
                {{ Form::select('agency', array(
                                '' => ''), isset($v->agency)?$v->agency:'', array(
                                'placeholder' =>Lang::get('rentals.agency'),
                                'class' => 'form-control')) 
                }}
            </div> 
        </div>
        <br/><div id="validation-div"></div>

        {{ Form::hidden('vehicle',$v->vehicle, array('id' => 'invisible_vehicle')) }}
        {{ Form::hidden('make', $v->Make, array('id' => 'invisible_make')) }}
        {{ Form::hidden('model',$v->Model, array('id' => 'invisible_model')) }}
        {{ Form::hidden('rentalId',$v->rentalId, array('id' => 'invisible_rentalId')) }}
        
        {{ Form::submit(Lang::get('rentals.check_out'), array('class' => 'btn btn-success btn-line')) }}          
        <input type="button" value="{{ Lang::get('messages.cancel_btn')}}" class="btn btn-danger btn-line" 
               onClick="history.go(-1);
                       return true;">
        {{ Form::close() }}
        @endforeach
    </div>
    <div id="div-customer"></div>
</div>

@stop


